package com.ly.mpayment.persist.entity.ele;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


/**
 * ElectronicAccount entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="electronic_account"

)

public class ElectronicAccount  implements java.io.Serializable {


    // Fields

     private String accId;
     private String accountName;
     private String password;
     private String payPassword;
     private String phoneNum;
     private Integer accstate;
     private Date createTime;
     private String comName;
     private BigDecimal balance;
     private String sessionToken;
     private String city;


     private Set<EleRecord> eleRecords = new HashSet<EleRecord>(0);


    // Constructors

    /** default constructor */
    public ElectronicAccount() {
    }

	/** minimal constructor */
    public ElectronicAccount(String accId) {
        this.accId = accId;
    }

    /** full constructor */
    public ElectronicAccount(String accId, String accountName, String password, String payPassword, String phoneNum, Integer accstate, Set<EleRecord> eleRecords) {
        this.accId = accId;
        this.accountName = accountName;
        this.password = password;
        this.payPassword = payPassword;
        this.phoneNum = phoneNum;
        this.accstate = accstate;
        this.eleRecords = eleRecords;
    }


    // Property accessors
    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name="acc_id", unique=true, nullable=false, length=36)
    public String getAccId() {
        return this.accId;
    }

    public void setAccId(String accId) {
        this.accId = accId;
    }

    @Column(name="account_name", length=20)

    public String getAccountName() {
        return this.accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    @Column(name="password", length=20)

    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name="pay_password", length=20)

    public String getPayPassword() {
        return this.payPassword;
    }

    public void setPayPassword(String payPassword) {
        this.payPassword = payPassword;
    }

    @Column(name="phone_num", length=20)

    public String getPhoneNum() {
        return this.phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    @Column(name="accstate")

    public Integer getAccstate() {
        return this.accstate;
    }

    public void setAccstate(Integer accstate) {
        this.accstate = accstate;
    }

    @Column(name="create_time")
    public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}



	@Column(name="com_name")
    public String getComName() {
		return comName;
	}

	public void setComName(String comName) {
		this.comName = comName;
	}

	@Column(name="balance")
	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	@Column(name="session_token")
	public String getSessionToken() {
		return sessionToken;
	}

	public void setSessionToken(String sessionToken) {
		this.sessionToken = sessionToken;
	}

	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="electronicAccount")
	public Set<EleRecord> getEleRecords() {
        return this.eleRecords;
    }

    public void setEleRecords(Set<EleRecord> eleRecords) {
        this.eleRecords = eleRecords;
    }
    @Column(name="city")
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}









}
